package com.example.servicebase.client;

import com.example.commonutils.ResultData;
import com.example.servicebase.entity.UrlObject;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OssClientFallbackFactory implements FallbackFactory<OssClient> {
    @Override
    public OssClient create(Throwable throwable) {
        return new OssClient() {
            @Override
            public ResultData deletePhoto(String url) {
                return ResultData.error().message("删除图片出错了");
            }

            @Override
            public ResultData deletePhoto(UrlObject url) {
                return ResultData.error().message("删除图片出错了");
            }
        };
    }
}
